home *** CD-ROM | disk | FTP | other *** search
/ Merciful 5 / Merciful - Disc 5.iso / software / p / personalpaint7.lha / PPaint / Rexx / AnimCharPath.pprx < prev    next >
Encoding:
Text File  |  1997-04-19  |  48.8 KB  |  1,839 lines

  1. /* Personal Paint Amiga Rexx script - Copyright © 1997 Cloanto Italia srl */
  2.  
  3. /* $VER: AnimCharPath.pprx 1.1 */
  4.  
  5. /** ENG
  6.  This script can be used to easily create animations with
  7.  moving and transforming characters (vector fonts).
  8.  
  9.  The main requester gives access to the following commands:
  10.  
  11.  - New: the path is cleared and the character settings are restored
  12.    to their default values.
  13.  
  14.  - Load: an existing path file can be selected using the file requester;
  15.    this causes the path coordinates, the brush transformation settings
  16.    and the animation settings to be loaded (note: this data
  17.    is stored in ASCII format and can easily be algorithmically
  18.    generated and manipulated by other programs).
  19.  
  20.  - Save: this command writes a path file using the current path data.
  21.  
  22.  - Define Freehand: the mouse can be used to "draw" the path;
  23.    both the direction of the path and the mouse movement speed
  24.    affect the resulting animation: the original direction
  25.    is used to render the frames (the starting point is used
  26.    to place the object in the first frame and the last point
  27.    is used for the last frame) and the drawing speed
  28.    affects the number and the "density" of stored points
  29.    (the slower the speed, the more points, and
  30.    vice versa) and defines the perceived speed of the animation
  31.    (e.g. a path defined with a high initial speed and a slow
  32.    ending speed leads to a corresponding animation).
  33.    Before the mouse button is pressed, the character is displayed
  34.    to ease positioning in the first frame.
  35.  
  36.  - Define Linear: the mouse can be used to define a linear path
  37.    (simply consisting of a starting point and an ending point);
  38.    unlike the freehand path, this kind of path produces a
  39.    constant-speed animation (equally-spaced intermediate points
  40.    are generated automatically).
  41.  
  42.  - Edit: this command can be used to visually edit the path;
  43.    the "path points" can be dragged with the mouse to change the
  44.    path shape and/or density (speed); the <m> key toggles
  45.    the magnify mode on or off, and the right mouse button or the <Esc> key
  46.    can be pressed to leave the editing mode.
  47.  
  48.  - Move and Resize: the mouse can be used to resize the animation
  49.    path (clicking on the lower right part of the path) or to drag it
  50.    to a new position (clicking on the upper part). This is useful
  51.    to create paths with point outside the screen, which cannot be
  52.    drawn by hand. The <m> key toggles the magnify mode on or off, and
  53.    the right mouse button or the <Esc> key can be pressed
  54.    to exit from the move and resize mode.
  55.  
  56.  - Character: the character requester can be used to select the
  57.    font to be used (the "Vector Font Path Selection" macro must be
  58.    run to select a font path other than "FONTS:"), the character,
  59.    its (initial) size, the handle position ("Base Left", "Base Center",
  60.    "Center") and the antialias level ("None", "Low", "Medium", "High").
  61.  
  62.  - Character Angle: the Character Angle requester is used to set
  63.    the number of character rotations ("Rotation Cycles"), the starting
  64.    ("From Angle") and ending angle ("To Angle"), and the
  65.    rotation direction ("Direction": "Clockwise/Counterclockwise");
  66.    a number of rotations greater than 1 can be used to add
  67.    additional 360° spins in the specified direction.
  68.  
  69.  - Character Shear: the Character Shear requester is used to set
  70.    the number of shear cycles ("Shear Cycles"), and the starting and
  71.    ending shear level ("From Angle", "To Angle"); if a number of
  72.    shear cycles greather than 1 is specified,
  73.    the shear factors will move back and forth within the specified
  74.    limits (an odd number of cycles must be used to reach the ending
  75.    shear in the last frame).
  76.  
  77.  - Character Boldness: the Character Boldness requester is used to set
  78.    the number of boldness cycles, the starting and
  79.    ending horizontal boldness level ("From Horizontal" and "To Horizontal"),
  80.    and the starting and ending vertical boldness ("From Vertical" and
  81.    "To Vertical"); if a number of cycles greather than 1
  82.    is specified, the boldness levels will move back and forth within
  83.    the specified limits (an odd number of cycles must be used to reach
  84.    the ending boldness in the last frame).
  85.  
  86.  - Character Size: the Character Size requester is used to set
  87.    the number of resize cycles ("Resize Cycles"), and the starting and
  88.    ending size ("From" and "To", in percentage of the initial size);
  89.    if a number of resize cycles greather than 1 is specified,
  90.    the resize factor will move back and forth within the specified
  91.    limits (an odd number of cycles must be used to reach the ending
  92.    size in the last frame).
  93.  
  94.  - Data: the Data requester is used to view all path information
  95.    at a glance (animation, character, rotation, shear, boldness
  96.    and resize settings, followed by the path coordinates).
  97.  
  98.  - Preview: this command is used to preview the animation (no antialiasing
  99.    is applied in preview mode).
  100.  
  101.  The main requester also contains gadgets to set the animation
  102.  frames ("Count"), the recording direction ("Direction":
  103.  "Forward/Backward/Still" - the frame step) and the frame insertion option
  104.  ("Add Frames" - if active, "Count" frames are inserted).
  105.  
  106.  When using freehand paths with no character effect, the "Count"
  107.  setting should not be set to a number greater than the path points
  108.  (as reported by the Data requester), as this would generate one or more
  109.  duplicate frames.
  110.  
  111.  The bottom gadgets in the main requester can be used to render
  112.  the animation ("Draw", which also terminates the script) or to
  113.  quit the script ("Quit"). A copy of the current path is
  114.  always temporarily stored, so that it can be used when the script is
  115.  run again.
  116. */
  117.  
  118. IF ARG(1, EXISTS) THEN
  119.     PARSE ARG PPPORT
  120. ELSE
  121.     PPPORT = 'PPAINT'
  122.  
  123. IF ~SHOW('P', PPPORT) THEN DO
  124.     IF EXISTS('PPaint:PPaint') THEN DO
  125.         ADDRESS COMMAND 'Run >NIL: PPaint:PPaint'
  126.         DO 30 WHILE ~SHOW('P',PPPORT)
  127.              ADDRESS COMMAND 'Wait >NIL: 1 SEC'
  128.         END
  129.     END
  130.     ELSE DO
  131.         SAY "Personal Paint could not be loaded."
  132.         EXIT 10
  133.     END
  134. END
  135.  
  136. IF ~SHOW('P', PPPORT) THEN DO
  137.     SAY 'Personal Paint Rexx port could not be opened'
  138.     EXIT 10
  139. END
  140.  
  141. ADDRESS VALUE PPPORT
  142. OPTIONS RESULTS
  143. OPTIONS FAILAT 10000
  144.  
  145. Get 'LANG'
  146. IF RESULT = 1 THEN DO        /* Deutsch */
  147.     global.txt_title_menu  = 'AnimCharacter Path'        /* *** ENG */
  148.     global.txt_title_new   = 'New AnimCharacter Path'
  149.     global.txt_title_load  = 'Load AnimCharacter Path'
  150.     global.txt_title_save  = 'Save AnimCharacter Path'
  151.     global.txt_title_fhand = 'Define Freehand Path'
  152.     global.txt_title_line  = 'Define Linear Path'
  153.     global.txt_title_edit  = 'Edit AnimCharacter Path'
  154.     global.txt_title_movrs = 'Move/Resize AnimCharacter Path'
  155.     global.txt_title_char  = 'Character'
  156.     global.txt_title_crot  = 'Character Angle'
  157.     global.txt_title_cshr  = 'Character Shear'
  158.     global.txt_title_cbold = 'Character Boldness'
  159.     global.txt_title_cresz = 'Character Size'
  160.     global.txt_title_pview = 'Preview Path'
  161.     global.txt_title_draw  = 'Draw Animation'
  162.     global.txt_title_data  = 'AnimCharacter Path Data'
  163.  
  164.     global.txt_menu_new    = 'New'
  165.     global.txt_menu_load   = 'Load...'
  166.     global.txt_menu_save   = 'Save...'
  167.     global.txt_menu_fhand  = 'Define Freehand'
  168.     global.txt_menu_line   = 'Define Linear'
  169.     global.txt_menu_edit   = 'Edit'
  170.     global.txt_menu_movrs  = 'Move and Resize'
  171.     global.txt_menu_char   = 'Character...'
  172.     global.txt_menu_crot   = 'Character Angle...'
  173.     global.txt_menu_cshr   = 'Character Shear...'
  174.     global.txt_menu_cbold  = 'Character Boldness...'
  175.     global.txt_menu_cresz  = 'Character Size...'
  176.     global.txt_menu_data   = 'Data...'
  177.     global.txt_menu_prview = 'Preview'
  178.  
  179.     global.txt_gad_count   = 'C_ount:'
  180.     global.txt_gad_add     = 'Add _Frames:'
  181.     global.txt_gad_noyes.0 = 'No'
  182.     global.txt_gad_noyes.1 = 'Yes'
  183.     global.txt_gad_direct  = 'Directi_on:'
  184.     global.txt_gad_dirct.0 = 'Forward'
  185.     global.txt_gad_dirct.1 = 'Backward'
  186.     global.txt_gad_dirct.2 = 'Still'
  187.     global.txt_gad_draw    = '_Draw'
  188.     global.txt_gad_quit    = '_Quit'
  189.     global.txt_gad_font    = '_Font:'
  190.     global.txt_gad_char    = 'Ch_aracter:'
  191.     global.txt_gad_size    = '_Size:'
  192.     global.txt_gad_handle  = '_Handle:'
  193.     global.txt_gad_aalias  = 'An_tialias:'
  194.     global.txt_gad_aals.0  = 'None'
  195.     global.txt_gad_aals.1  = 'Low'
  196.     global.txt_gad_aals.2  = 'Medium'
  197.     global.txt_gad_aals.3  = 'High'
  198.     global.txt_gad_handl.0 = 'Base Left'
  199.     global.txt_gad_handl.1 = 'Base Center'
  200.     global.txt_gad_handl.2 = 'Center'
  201.     global.txt_gad_rotats  = '_Rotation Cycles:'
  202.     global.txt_gad_fromang = '_From Angle:'
  203.     global.txt_gad_toang   = '_To Angle:'
  204.     global.txt_gad_rotdir  = '_Direction:'
  205.     global.txt_gad_rotdr.0 = 'Clockwise'
  206.     global.txt_gad_rotdr.1 = 'Counterclockwise'
  207.     global.txt_gad_shears  = '_Shear Cycles:'
  208.     global.txt_gad_fromsh  = '_From Angle:'
  209.     global.txt_gad_tosh    = '_To Angle:'
  210.     global.txt_gad_resizes = 'Re_size Cycles:'
  211.     global.txt_gad_fromrs  = '_From (%):'
  212.     global.txt_gad_tors    = '_To (%):'
  213.     global.txt_gad_bolds   = '_Boldness Cycles:'
  214.     global.txt_gad_frombdx = '_From Horizontal:'
  215.     global.txt_gad_tobdx   = '_To Horizontal:'
  216.     global.txt_gad_frombdy = 'F_rom Vertical:'
  217.     global.txt_gad_tobdy   = 'T_o Vertical:'
  218.     global.txt_msg_points  = 'Points:'
  219.     global.txt_msg_ptype.0 = '(freehand path)'
  220.     global.txt_msg_ptype.1 = '(linear path)'
  221.  
  222.     global.txt_err_oldcl   = 'This script requires a newer_version of Personal Paint'
  223.     global.txt_err_lost    = 'The path will be lost'
  224.     global.txt_err_load    = 'The path file cannot be opened'
  225.     global.txt_err_nopath  = 'No path has been defined'
  226.     global.txt_err_save    = 'The path cannot be saved'
  227.     global.txt_err_notbsh  = 'No space for temporary brush'
  228.     global.txt_err_nofonts = 'Vector fonts not found'
  229.     global.txt_err_rend    = 'Character rendering error'
  230. END
  231. ELSE IF RESULT = 2 THEN DO        /* Italiano */
  232.     global.txt_title_menu  = 'Percorso AnimCharacter'
  233.     global.txt_title_new   = 'Nuovo percorso AnimCharacter'
  234.     global.txt_title_load  = 'Leggere percorso AnimCharacter'
  235.     global.txt_title_save  = 'Scrivere percorso AnimCharacter'
  236.     global.txt_title_fhand = 'Definire a mano libera'
  237.     global.txt_title_line  = 'Definire lineare'
  238.     global.txt_title_edit  = 'Modificare percorso AnimCharacter'
  239.     global.txt_title_movrs = 'Spostare percorso AnimCharacter'
  240.     global.txt_title_char  = 'Carattere'
  241.     global.txt_title_crot  = 'Angolo carattere'
  242.     global.txt_title_cshr  = 'Inclinazione carattere'
  243.     global.txt_title_cbold = 'Spessore carattere'
  244.     global.txt_title_cresz = 'Dimensione carattere'
  245.     global.txt_title_pview = 'Anteprima animazione'
  246.     global.txt_title_draw  = 'Creare animazione'
  247.     global.txt_title_data  = 'Dati percorso animazione'
  248.  
  249.     global.txt_menu_new    = 'Nuovo'
  250.     global.txt_menu_load   = 'Leggere...'
  251.     global.txt_menu_save   = 'Scrivere...'
  252.     global.txt_menu_fhand  = 'Definire a mano libera'
  253.     global.txt_menu_line   = 'Definire lineare'
  254.     global.txt_menu_edit   = 'Modificare'
  255.     global.txt_menu_movrs  = 'Spostare e ridimensionare'
  256.     global.txt_menu_char   = 'Carattere...'
  257.     global.txt_menu_crot   = 'Angolo carattere...'
  258.     global.txt_menu_cshr   = 'Inclinazione carattere...'
  259.     global.txt_menu_cbold  = 'Spessore carattere...'
  260.     global.txt_menu_cresz  = 'Dimensione carattere...'
  261.     global.txt_menu_data   = 'Dati...'
  262.     global.txt_menu_prview = 'Anteprima'
  263.  
  264.     global.txt_gad_count   = 'Pa_ssi:'
  265.     global.txt_gad_add     = 'Aggiunta _fotogrammi:'
  266.     global.txt_gad_noyes.0 = 'No'
  267.     global.txt_gad_noyes.1 = 'Sì'
  268.     global.txt_gad_direct  = 'Direzi_one:'
  269.     global.txt_gad_dirct.0 = 'Avanti'
  270.     global.txt_gad_dirct.1 = 'Indietro'
  271.     global.txt_gad_dirct.2 = 'Fermo'
  272.     global.txt_gad_draw    = '_Animare'
  273.     global.txt_gad_quit    = '_Uscire'
  274.     global.txt_gad_font    = '_Font:'
  275.     global.txt_gad_char    = '_Carattere:'
  276.     global.txt_gad_size    = '_Dimensione:'
  277.     global.txt_gad_handle  = '_Impugnatura:'
  278.     global.txt_gad_aalias  = 'An_tialias:'
  279.     global.txt_gad_aals.0  = 'Nessuno'
  280.     global.txt_gad_aals.1  = 'Basso'
  281.     global.txt_gad_aals.2  = 'Medio'
  282.     global.txt_gad_aals.3  = 'Alto'
  283.     global.txt_gad_handl.0 = 'Base sinistra'
  284.     global.txt_gad_handl.1 = 'Base centro'
  285.     global.txt_gad_handl.2 = 'Centro'
  286.     global.txt_gad_rotats  = 'Cicli _rotazione:'
  287.     global.txt_gad_fromang = '_Da angolo:'
  288.     global.txt_gad_toang   = 'Ad a_ngolo:'
  289.     global.txt_gad_rotdir  = '_Senso:'
  290.     global.txt_gad_rotdr.0 = 'Orario'
  291.     global.txt_gad_rotdr.1 = 'Antiorario'
  292.     global.txt_gad_shears  = 'Cicli _inclinazione:'
  293.     global.txt_gad_fromsh  = '_Da angolo:'
  294.     global.txt_gad_tosh    = 'Ad a_ngolo:'
  295.     global.txt_gad_resizes = 'Cicli _ridimensionamento:'
  296.     global.txt_gad_fromrs  = '_Da (%):'
  297.     global.txt_gad_tors    = 'A (_%):'
  298.     global.txt_gad_bolds   = 'Cicli _spessore:'
  299.     global.txt_gad_frombdx = '_Da orizzontale:'
  300.     global.txt_gad_tobdx   = 'A ori_zzontale:'
  301.     global.txt_gad_frombdy = 'Da _verticale:'
  302.     global.txt_gad_tobdy   = 'A ver_ticale:'
  303.     global.txt_msg_points  = 'Punti:'
  304.     global.txt_msg_ptype.0 = '(percorso a mano libera)'
  305.     global.txt_msg_ptype.1 = '(percorso lineare)'
  306.  
  307.     global.txt_err_oldcl   = 'Questa procedura richiede_una versione più recente_di Personal Paint'
  308.     global.txt_err_lost    = 'Il percorso sarà cancellato'
  309.     global.txt_err_load    = 'Il file non può essere aperto'
  310.     global.txt_err_nopath  = 'Non è stato definito alcun percorso'
  311.     global.txt_err_save    = 'Il percorso non può essere scritto'
  312.     global.txt_err_notbsh  = 'Non vi è spazio per il pennello temporaneo'
  313.     global.txt_err_nofonts = 'Non vi sono font vettoriali'
  314.     global.txt_err_rend    = 'Errore nella creazione del carattere'
  315. END
  316. ELSE DO                /* English */
  317.     global.txt_title_menu  = 'AnimCharacter Path'
  318.     global.txt_title_new   = 'New AnimCharacter Path'
  319.     global.txt_title_load  = 'Load AnimCharacter Path'
  320.     global.txt_title_save  = 'Save AnimCharacter Path'
  321.     global.txt_title_fhand = 'Define Freehand Path'
  322.     global.txt_title_line  = 'Define Linear Path'
  323.     global.txt_title_edit  = 'Edit AnimCharacter Path'
  324.     global.txt_title_movrs = 'Move/Resize AnimCharacter Path'
  325.     global.txt_title_char  = 'Character'
  326.     global.txt_title_crot  = 'Character Angle'
  327.     global.txt_title_cshr  = 'Character Shear'
  328.     global.txt_title_cbold = 'Character Boldness'
  329.     global.txt_title_cresz = 'Character Size'
  330.     global.txt_title_pview = 'Preview Path'
  331.     global.txt_title_draw  = 'Draw Animation'
  332.     global.txt_title_data  = 'AnimCharacter Path Data'
  333.  
  334.     global.txt_menu_new    = 'New'
  335.     global.txt_menu_load   = 'Load...'
  336.     global.txt_menu_save   = 'Save...'
  337.     global.txt_menu_fhand  = 'Define Freehand'
  338.     global.txt_menu_line   = 'Define Linear'
  339.     global.txt_menu_edit   = 'Edit'
  340.     global.txt_menu_movrs  = 'Move and Resize'
  341.     global.txt_menu_char   = 'Character...'
  342.     global.txt_menu_crot   = 'Character Angle...'
  343.     global.txt_menu_cshr   = 'Character Shear...'
  344.     global.txt_menu_cbold  = 'Character Boldness...'
  345.     global.txt_menu_cresz  = 'Character Size...'
  346.     global.txt_menu_data   = 'Data...'
  347.     global.txt_menu_prview = 'Preview'
  348.  
  349.     global.txt_gad_count   = 'C_ount:'
  350.     global.txt_gad_add     = 'Add _Frames:'
  351.     global.txt_gad_noyes.0 = 'No'
  352.     global.txt_gad_noyes.1 = 'Yes'
  353.     global.txt_gad_direct  = 'Directi_on:'
  354.     global.txt_gad_dirct.0 = 'Forward'
  355.     global.txt_gad_dirct.1 = 'Backward'
  356.     global.txt_gad_dirct.2 = 'Still'
  357.     global.txt_gad_draw    = '_Draw'
  358.     global.txt_gad_quit    = '_Quit'
  359.     global.txt_gad_font    = '_Font:'
  360.     global.txt_gad_char    = 'Ch_aracter:'
  361.     global.txt_gad_size    = '_Size:'
  362.     global.txt_gad_handle  = '_Handle:'
  363.     global.txt_gad_aalias  = 'An_tialias:'
  364.     global.txt_gad_aals.0  = 'None'
  365.     global.txt_gad_aals.1  = 'Low'
  366.     global.txt_gad_aals.2  = 'Medium'
  367.     global.txt_gad_aals.3  = 'High'
  368.     global.txt_gad_handl.0 = 'Base Left'
  369.     global.txt_gad_handl.1 = 'Base Center'
  370.     global.txt_gad_handl.2 = 'Center'
  371.     global.txt_gad_rotats  = '_Rotation Cycles:'
  372.     global.txt_gad_fromang = '_From Angle:'
  373.     global.txt_gad_toang   = '_To Angle:'
  374.     global.txt_gad_rotdir  = '_Direction:'
  375.     global.txt_gad_rotdr.0 = 'Clockwise'
  376.     global.txt_gad_rotdr.1 = 'Counterclockwise'
  377.     global.txt_gad_shears  = '_Shear Cycles:'
  378.     global.txt_gad_fromsh  = '_From Angle:'
  379.     global.txt_gad_tosh    = '_To Angle:'
  380.     global.txt_gad_resizes = 'Re_size Cycles:'
  381.     global.txt_gad_fromrs  = '_From (%):'
  382.     global.txt_gad_tors    = '_To (%):'
  383.     global.txt_gad_bolds   = '_Boldness Cycles:'
  384.     global.txt_gad_frombdx = '_From Horizontal:'
  385.     global.txt_gad_tobdx   = '_To Horizontal:'
  386.     global.txt_gad_frombdy = 'F_rom Vertical:'
  387.     global.txt_gad_tobdy   = 'T_o Vertical:'
  388.     global.txt_msg_points  = 'Points:'
  389.     global.txt_msg_ptype.0 = '(freehand path)'
  390.     global.txt_msg_ptype.1 = '(linear path)'
  391.  
  392.     global.txt_err_oldcl   = 'This script requires a newer_version of Personal Paint'
  393.     global.txt_err_lost    = 'The path will be lost'
  394.     global.txt_err_load    = 'The path file cannot be opened'
  395.     global.txt_err_nopath  = 'No path has been defined'
  396.     global.txt_err_save    = 'The path cannot be saved'
  397.     global.txt_err_notbsh  = 'No space for temporary brush'
  398.     global.txt_err_nofonts = 'Vector fonts not found'
  399.     global.txt_err_rend    = 'Character rendering error'
  400. END
  401.  
  402. Version 'REXX'
  403. IF RESULT < 7 THEN DO
  404.     RequestNotify 'PROMPT "'global.txt_err_oldcl'"'
  405.     EXIT 10
  406. END
  407.  
  408. tmpname = 'T:PP_AnimCharPath'
  409.  
  410. global.fontnum = 0
  411. global.pathdisp = 1
  412.  
  413. CALL DefData
  414.  
  415. LockGUI
  416.  
  417. GetPaintMode
  418. global.savepmode = RESULT
  419.  
  420. GetBrushAttributes 'WIDTH'
  421. global.bshw = RESULT
  422. GetBrushAttributes 'HEIGHT'
  423. global.bshh = RESULT
  424. GetBrushAttributes 'HANDLEX'
  425. global.bshhx = RESULT
  426. GetBrushAttributes 'HANDLEY'
  427. global.bshhy = RESULT
  428.  
  429. GetBrushAttributes 'FRAMES'
  430. global.savebshfr = RESULT
  431. GetBrushAttributes 'FRAMEPOSITION'
  432. global.savebshfp = RESULT
  433. GetBrushNumber
  434. global.savebshnum = RESULT
  435. GetCurrentBrush
  436. global.savebsh = RESULT
  437.  
  438. SetCurrentBrush 'UNUSED'
  439. IF RC ~= 0 THEN DO
  440.     RequestNotify 'TITLE "'global.txt_title_menu'" PROMPT "'global.txt_err_notbsh'"'
  441.     UnlockGUI
  442.     EXIT 0
  443. END
  444. GetBrushNumber
  445. global.tbshnum = RESULT
  446.  
  447. SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  448.  
  449. GetPen 'FOREGROUND'
  450. global.savepen = RESULT
  451. Get 'COLORS'
  452. global.xorpen = RESULT-1
  453. SetPen 'FOREGROUND' global.xorpen
  454.  
  455. Get 'BARS'
  456. savebars = RESULT
  457. Set '"BARS=0"'
  458.  
  459. Get 'GCLIP'
  460. saveclip = RESULT
  461. Set '"GCLIP=0"'
  462.  
  463. Get 'COORD'
  464. savecoord = RESULT
  465. Set '"COORD=0"'
  466.  
  467. DisableTools
  468. UnlockGUI
  469.  
  470. SIGNAL ON Break_C
  471.  
  472. /* load last used path and display it */
  473. CALL LoadPathFile(tmpname)
  474. CALL XorPath
  475.  
  476. Get 'SCREENH'
  477. IF RESULT < 225 THEN
  478.     mrows = 11
  479. ELSE
  480.     mrows = 14
  481.  
  482. command = 0
  483. DO FOREVER
  484.     Request '"'global.txt_title_menu'" COMPACT ',
  485.             '"LIST ACTION = , 14, 'command', 20, 'mrows', ',
  486.             ' ""'global.txt_menu_new'"", ',
  487.             ' ""'global.txt_menu_load'"", ',
  488.             ' ""'global.txt_menu_save'"", ',
  489.             ' ""'global.txt_menu_fhand'"", ',
  490.             ' ""'global.txt_menu_line'"", ',
  491.             ' ""'global.txt_menu_edit'"", ',
  492.             ' ""'global.txt_menu_movrs'"", ',
  493.             ' ""'global.txt_menu_char'"", ',
  494.             ' ""'global.txt_menu_crot'"", ',
  495.             ' ""'global.txt_menu_cshr'"", ',
  496.             ' ""'global.txt_menu_cbold'"", ',
  497.             ' ""'global.txt_menu_cresz'"", ',
  498.             ' ""'global.txt_menu_data'"", ',
  499.             ' ""'global.txt_menu_prview'"" ',
  500.             ' VSPACE = 4 ',
  501.             ' INTSTR = ""'global.txt_gad_count'"", 1, 32000, 'global.count' ',
  502.             ' VSPACE = 2 ',
  503.             ' CYCLE = ""'global.txt_gad_direct'"", 3, 'global.direct', ""'global.txt_gad_dirct.0'"", ""'global.txt_gad_dirct.1'"", ""'global.txt_gad_dirct.2'"" ' ||,
  504.             ' VSPACE = 2 ',
  505.             ' CHECK = ""'global.txt_gad_add'"", 'global.add' ' ||,
  506.             ' VSPACE = 2 ',
  507.             ' ACTION = ""'global.txt_gad_draw'"" ',
  508.             ' ACTION = ""'global.txt_gad_quit'"" "'
  509.     IF RC = 0 THEN DO
  510.         command = RESULT.1
  511.         global.count = RESULT.2
  512.         global.direct = RESULT.3
  513.         global.add = RESULT.4
  514.  
  515.         IF RESULT = 1 THEN DO    /* Draw */
  516.             IF DrawIt() THEN
  517.                 LEAVE
  518.         END
  519.         ELSE IF RESULT = 2 THEN    /* Quit */
  520.             LEAVE
  521.         ELSE DO     /* Command List */
  522.             IF      command = 0 THEN CALL NewPath
  523.             ELSE IF command = 1 THEN CALL LoadPath
  524.             ELSE IF command = 2 THEN CALL SavePath
  525.             ELSE IF command = 3 THEN CALL DefFreehand
  526.             ELSE IF command = 4 THEN CALL DefLinear
  527.             ELSE IF command = 5 THEN CALL EditPath
  528.             ELSE IF command = 6 THEN CALL MoveResizePath
  529.             ELSE IF command = 7 THEN CALL CharSettings
  530.             ELSE IF command = 8 THEN CALL RotSettings
  531.             ELSE IF command = 9 THEN CALL ShearSettings
  532.             ELSE IF command = 10 THEN CALL BoldSettings
  533.             ELSE IF command = 11 THEN CALL ResizeSettings
  534.             ELSE IF command = 12 THEN CALL DisplayData
  535.             ELSE IF command = 13 THEN CALL PreviewPath
  536.         END
  537.     END
  538. END
  539.  
  540. CALL SavePathFile(tmpname)
  541. CALL Break_C
  542.  
  543. EXIT 0
  544.  
  545.  
  546.  
  547.  
  548.  
  549. DefData: PROCEDURE EXPOSE global.
  550.  
  551.     global.count  = 10
  552.     global.direct = 0
  553.     global.add    = 1
  554.  
  555.     global.fontpath = 'FONTS:'
  556.     global.font     = 'CGTimes'
  557.     global.char     = 'A'
  558.     global.size     = '45'
  559.     global.handle   = 1
  560.     global.aalias   = 0
  561.  
  562.     global.rotats  = 1
  563.     global.fromang = 0 * 10000
  564.     global.toang   = 0 * 10000
  565.     global.rotdir  = 0
  566.  
  567.     global.shears  = 1
  568.     global.fromsh  = 0 * 10000
  569.     global.tosh    = 0 * 10000
  570.  
  571.     global.resizes = 1
  572.     global.fromrs  = 100 * 10000
  573.     global.tors    = 100 * 10000
  574.  
  575.     global.bolds   = 1
  576.     global.frombdx = 0 * 10000
  577.     global.tobdx   = 0 * 10000
  578.     global.frombdy = 0 * 10000
  579.     global.tobdy   = 0 * 10000
  580.  
  581.     global.points = 0
  582.     DROP global.xcoord. global.ycoord.
  583.  
  584.     RETURN
  585.  
  586.  
  587.  
  588.  
  589. NewPath: PROCEDURE EXPOSE global.
  590.  
  591.     RequestResponse 'TITLE "'global.txt_title_new'" PROMPT "'global.txt_err_lost'"'
  592.     IF RC = 0 THEN DO
  593.         IF global.points > 0 THEN
  594.             CALL XorPath
  595.  
  596.         CALL DefData
  597.     END
  598.  
  599.     RETURN
  600.  
  601.  
  602.  
  603.  
  604. LoadPathFile: PROCEDURE EXPOSE global.
  605.  
  606.     ok = 0
  607.     IF OPEN('pfile', ARG(1), 'R') THEN DO
  608.         LockGUI
  609.         IF READLN('pfile') = 'PPAINT CPATH' THEN DO
  610.             IF READLN('pfile') = '1' THEN DO
  611.                 global.count  = READLN('pfile')
  612.                 global.direct = READLN('pfile')
  613.                 global.add    = READLN('pfile')
  614.  
  615.                 global.fontpath = READLN('pfile')
  616.                 global.font     = READLN('pfile')
  617.                 global.char     = READLN('pfile')
  618.                 global.size     = READLN('pfile')
  619.                 global.handle   = READLN('pfile')
  620.                 global.aalias   = READLN('pfile')
  621.  
  622.                 global.rotats  = READLN('pfile')
  623.                 global.fromang = READLN('pfile')
  624.                 global.toang   = READLN('pfile')
  625.                 global.rotdir  = READLN('pfile')
  626.  
  627.                 global.shears  = READLN('pfile')
  628.                 global.fromsh  = READLN('pfile')
  629.                 global.tosh    = READLN('pfile')
  630.  
  631.                 global.resizes = READLN('pfile')
  632.                 global.fromrs  = READLN('pfile')
  633.                 global.tors    = READLN('pfile')
  634.  
  635.                 global.bolds   = READLN('pfile')
  636.                 global.frombdx = READLN('pfile')
  637.                 global.tobdx   = READLN('pfile')
  638.                 global.frombdy = READLN('pfile')
  639.                 global.tobdy   = READLN('pfile')
  640.  
  641.                 global.points = READLN('pfile')
  642.  
  643.                 DO point = 0 FOR global.points
  644.                     xy = READLN('pfile')
  645.                     PARSE VAR xy global.xcoord.point global.ycoord.point .
  646.                 END
  647.                 ok = 1
  648.             END
  649.         END
  650.         CALL CLOSE('pfile')
  651.         UnlockGUI
  652.     END
  653.  
  654.     RETURN ok
  655.  
  656.  
  657.  
  658.  
  659. LoadPath: PROCEDURE EXPOSE global.
  660.  
  661.     RequestFile 'TITLE "'global.txt_title_load'"'
  662.     IF RC = 0 THEN DO
  663.         PARSE VALUE RESULT WITH '"' pfilename '"'
  664.  
  665.         IF global.points > 0 THEN DO
  666.             CALL XorPath
  667.             CALL DefData
  668.         END
  669.  
  670.         IF LoadPathFile(pfilename) THEN
  671.             CALL XorPath
  672.         ELSE DO
  673.             CALL DefData
  674.             RequestNotify 'TITLE "'global.txt_title_load'" PROMPT "'global.txt_err_load'"'
  675.         END
  676.     END
  677.  
  678.     RETURN
  679.  
  680.  
  681.  
  682.  
  683. SavePathFile: PROCEDURE EXPOSE global.
  684.  
  685.     ok = 0
  686.     IF OPEN('pfile', ARG(1), 'W') THEN DO
  687.         LockGUI
  688.         CALL WRITELN('pfile', 'PPAINT CPATH')
  689.         CALL WRITELN('pfile', '1')        /* version */
  690.  
  691.         CALL WRITELN('pfile', global.count)
  692.         CALL WRITELN('pfile', global.direct)
  693.         CALL WRITELN('pfile', global.add)
  694.  
  695.         CALL WRITELN('pfile', global.fontpath)
  696.         CALL WRITELN('pfile', global.font)
  697.       CALL WRITELN('pfile', global.char)
  698.         CALL WRITELN('pfile', global.size)
  699.         CALL WRITELN('pfile', global.handle)
  700.         CALL WRITELN('pfile', global.aalias)
  701.  
  702.         CALL WRITELN('pfile', global.rotats)
  703.         CALL WRITELN('pfile', global.fromang)
  704.         CALL WRITELN('pfile', global.toang)
  705.         CALL WRITELN('pfile', global.rotdir)
  706.  
  707.         CALL WRITELN('pfile', global.shears)
  708.         CALL WRITELN('pfile', global.fromsh)
  709.         CALL WRITELN('pfile', global.tosh)
  710.  
  711.         CALL WRITELN('pfile', global.resizes)
  712.         CALL WRITELN('pfile', global.fromrs)
  713.         CALL WRITELN('pfile', global.tors)
  714.  
  715.         CALL WRITELN('pfile', global.bolds)
  716.         CALL WRITELN('pfile', global.frombdx)
  717.         CALL WRITELN('pfile', global.tobdx)
  718.         CALL WRITELN('pfile', global.frombdy)
  719.         CALL WRITELN('pfile', global.tobdy)
  720.  
  721.         CALL WRITELN('pfile', global.points)
  722.  
  723.         DO point = 0 FOR global.points
  724.             CALL WRITELN('pfile', global.xcoord.point' 'global.ycoord.point)
  725.         END
  726.         ok = 1
  727.         CALL CLOSE('pfile')
  728.         UnlockGUI
  729.     END
  730.  
  731.     RETURN ok
  732.  
  733.  
  734.  
  735.  
  736. SavePath: PROCEDURE EXPOSE global.
  737.  
  738.     IF global.points = 0 THEN DO
  739.         RequestNotify 'TITLE "'global.txt_title_save'" PROMPT "'global.txt_err_nopath'"'
  740.         RETURN
  741.     END
  742.  
  743.     RequestFile 'TITLE "'global.txt_title_save'" SAVEMODE'
  744.     IF RC = 0 THEN DO
  745.         PARSE VALUE RESULT WITH '"' pfilename '"'
  746.         IF ~SavePathFile(pfilename) THEN
  747.             RequestNotify 'TITLE "'global.txt_title_save'" PROMPT "'global.txt_err_save'"'
  748.     END
  749.  
  750.     RETURN
  751.  
  752.  
  753.  
  754.  
  755. XorVertex: PROCEDURE EXPOSE global.
  756.  
  757.     point = ARG(1)
  758.  
  759.     IF point > 0 THEN DO
  760.         IF point = 1 THEN
  761.             nfp = ''
  762.         ELSE
  763.             nfp = 'NOFIRSTPIXEL'
  764.         ppt = point - 1
  765.         DrawLine global.xcoord.ppt global.ycoord.ppt global.xcoord.point global.ycoord.point 'COMPLEMENT' nfp
  766.     END
  767.     npt = point + 1
  768.     IF npt < global.points THEN DO
  769.         IF point = 0 THEN
  770.             nfp = ''
  771.         ELSE
  772.             nfp = 'NOFIRSTPIXEL'
  773.         DrawLine global.xcoord.point global.ycoord.point global.xcoord.npt global.ycoord.npt 'COMPLEMENT' nfp
  774.     END
  775.  
  776.     RETURN
  777.  
  778.  
  779.  
  780.  
  781. EditPath: PROCEDURE EXPOSE global.
  782.  
  783.     IF global.points = 0 THEN DO
  784.         RequestNotify 'TITLE "'global.txt_title_edit'" PROMPT "'global.txt_err_nopath'"'
  785.         RETURN
  786.     END
  787.  
  788.     SetPointer 'DATA ',
  789.         '"0xC000,0x7000,0x3C00,0x3F00,0x1F00,0x1E00,0x0B00,0x0980,',
  790.         ' 0x0080,0x0000,0x0018,0x003C,0x0018,',
  791.         ' 0x4000,0xB000,0x4C00,0x4300,0x2000,0x2200,0x1500,0x1280,',
  792.         ' 0x0100,0x0000,0x0028,0x0044,0x0028" ',
  793.         'HEIGHT 13 OFFSETX -1 OFFSETY 0'
  794.  
  795.     DO FOREVER
  796.         WaitForClick 'DOWN POINT SHOWBRUSH'
  797.         IF RC = 0 THEN DO
  798.             PARSE VAR RESULT button xp yp .
  799.  
  800.             IF button > 1 THEN
  801.                 LEAVE
  802.             mindist = 30000
  803.             DO point = 0 FOR global.points
  804.                 GetDistance xp yp global.xcoord.point global.ycoord.point 'IMAGERATIO'
  805.                 IF RESULT < mindist THEN DO
  806.                     mindist = RESULT
  807.                     mindpt = point
  808.                 END
  809.             END
  810.             point = mindpt
  811.             prev_xp = xp
  812.             prev_yp = yp
  813.             drawn = 0
  814.  
  815.             DO FOREVER
  816.                 GetMousePosition
  817.                 PARSE VAR RESULT xp yp .
  818.  
  819.                 IF xp ~= prev_xp | yp ~= prev_yp | ~drawn THEN DO
  820.                     CALL XorVertex(point)
  821.                     global.xcoord.point = xp
  822.                     global.ycoord.point = yp
  823.                     CALL XorVertex(point)
  824.  
  825.                     prev_xp = xp
  826.                     prev_yp = yp
  827.                     drawn = 1
  828.                 END
  829.                 ELSE WaitForEvent
  830.  
  831.                 GetMouseButton
  832.                 IF RESULT = 0 THEN
  833.                     LEAVE
  834.             END
  835.         END
  836.         ELSE LEAVE
  837.     END
  838.     SetPointer
  839.     RETURN
  840.  
  841.  
  842.  
  843.  
  844. MoveResizePath: PROCEDURE EXPOSE global.
  845.  
  846.     IF global.points = 0 THEN DO
  847.         RequestNotify 'TITLE "'global.txt_title_movrs'" PROMPT "'global.txt_err_nopath'"'
  848.         RETURN
  849.     END
  850.  
  851.     SetPointer 'DATA ',
  852.         '"0xC000,0x7000,0x3C00,0x3F00,0x1FC0,0x1FC0,0x0F00,0x0D80,',
  853.         ' 0x04C0,0x0460,0x0020,',
  854.         ' 0x4000,0xB000,0x4C00,0x4300,0x20C0,0x2000,0x1100,0x1280,',
  855.         ' 0x0940,0x08A0,0x0040" ',
  856.         'HEIGHT 11 OFFSETX -1 OFFSETY 0'
  857.     minx = 32000
  858.     miny = 32000
  859.     maxx = -32000
  860.     maxy = -32000
  861.     DO point = 0 FOR global.points
  862.         IF global.xcoord.point < minx THEN minx = global.xcoord.point
  863.         IF global.xcoord.point > maxx THEN maxx = global.xcoord.point
  864.         IF global.ycoord.point < miny THEN miny = global.ycoord.point
  865.         IF global.ycoord.point > maxy THEN maxy = global.ycoord.point
  866.  
  867.         origxc.point = global.xcoord.point
  868.         origyc.point = global.ycoord.point
  869.     END
  870.     w1 = maxx - minx
  871.     h1 = maxy - miny
  872.     minx00 = minx
  873.     miny00 = miny
  874.     w100 = w1
  875.     h100 = h1
  876.  
  877.     DO FOREVER
  878.         WaitForClick 'DOWN POINT'
  879.         IF RC = 0 THEN DO
  880.             PARSE VAR RESULT button xp yp .
  881.  
  882.             IF button > 1 THEN
  883.                 LEAVE
  884.             resize = (xp > minx+w1/2 & yp > miny+h1/2)
  885.             IF resize THEN DO
  886.                 SetPointer 'DATA ',
  887.                     '"0xC000,0x7000,0x3C00,0x3F00,0x1F00,0x1E00,0x0B00,0x0980,',
  888.                     ' 0x00E0,0x00A0,0x00FE,0x0022,0x0022,0x0022,0x003E,',
  889.                     ' 0x4000,0xB000,0x4C00,0x4300,0x2000,0x2200,0x1500,0x1280,',
  890.                     ' 0x0100,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000" ',
  891.                     'HEIGHT 15 OFFSETX -1 OFFSETY 0'
  892.                 w10 = w1
  893.                 h10 = h1
  894.             END
  895.             ELSE DO
  896.                 minx0 = minx
  897.                 miny0 = miny
  898.             END
  899.             CALL XorPath
  900.             DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  901.             prev_xp = xp
  902.             prev_yp = yp
  903.  
  904.             DO FOREVER
  905.                 GetMousePosition
  906.                 PARSE VAR RESULT xp yp .
  907.  
  908.                 IF xp ~= prev_xp | yp ~= prev_yp THEN DO
  909.                     DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  910.                     IF resize THEN DO
  911.                         w1 = w1 + (xp - prev_xp)
  912.                         h1 = h1 + (yp - prev_yp)
  913.                         IF w1 < 1 THEN w1 = 1
  914.                         IF h1 < 1 THEN h1 = 1
  915.                         maxx = minx + w1
  916.                         maxy = miny + h1
  917.                     END
  918.                     ELSE DO
  919.                         minx = minx + (xp - prev_xp)
  920.                         miny = miny + (yp - prev_yp)
  921.                         maxx = minx + w1
  922.                         maxy = miny + h1
  923.                     END
  924.                     DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  925.                     prev_xp = xp
  926.                     prev_yp = yp
  927.                 END
  928.                 ELSE WaitForEvent
  929.  
  930.                 GetMouseButton
  931.                 IF RESULT = 0 THEN
  932.                     LEAVE
  933.             END
  934.  
  935.             DrawRectangle minx miny maxx maxy 'COMPLEMENT'
  936.             IF resize THEN DO
  937.                 IF w10 ~= w1 | h10 ~= h1 THEN DO
  938.                     mx = w1 / w100
  939.                     my = h1 / h100
  940.                     DO point = 0 FOR global.points
  941.                         global.xcoord.point = minx + TRUNC((origxc.point - minx00) * mx)
  942.                         global.ycoord.point = miny + TRUNC((origyc.point - miny00) * my)
  943.                     END
  944.                 END
  945.                 SetPointer 'DATA ',
  946.                     '"0xC000,0x7000,0x3C00,0x3F00,0x1FC0,0x1FC0,0x0F00,0x0D80,',
  947.                     ' 0x04C0,0x0460,0x0020,',
  948.                     ' 0x4000,0xB000,0x4C00,0x4300,0x20C0,0x2000,0x1100,0x1280,',
  949.                     ' 0x0940,0x08A0,0x0040" ',
  950.                     'HEIGHT 11 OFFSETX -1 OFFSETY 0'
  951.             END
  952.             ELSE DO
  953.                 IF minx ~= minx0 | miny ~= miny0 THEN DO
  954.                     dx = minx - minx0
  955.                     dy = miny - miny0
  956.                     DO point = 0 FOR global.points
  957.                         global.xcoord.point = global.xcoord.point + dx
  958.                         global.ycoord.point = global.ycoord.point + dy
  959.                     END
  960.                 END
  961.             END
  962.             CALL XorPath
  963.         END
  964.         ELSE LEAVE
  965.     END
  966.     SetPointer
  967.  
  968.     RETURN
  969.  
  970.  
  971.  
  972.  
  973. SetFirstChar: PROCEDURE EXPOSE global.
  974.  
  975.     SetCurrentBrush 'BRUSH' global.tbshnum
  976.     IF RC ~= 0 THEN
  977.         RETURN
  978.  
  979.     global.rot_ang = global.fromang
  980.     global.shear = global.fromsh
  981.     global.bold_x = global.frombdx
  982.     global.bold_y = global.frombdy
  983.     global.resize = global.fromrs
  984.     IF CreateCharacter(0) THEN DO
  985.         SetPaintMode 'COLOR'
  986.         SetPen 'FOREGROUND' global.savepen
  987.         RETURN 1
  988.     END
  989.  
  990.     RETURN 0
  991.  
  992.  
  993.  
  994.  
  995. DefFreehand: PROCEDURE EXPOSE global.
  996.  
  997.     LockGUI
  998.     IF global.points > 0 THEN DO
  999.         CALL XorPath
  1000.         DROP global.xcoord. global.ycoord.
  1001.         global.points = 0
  1002.     END
  1003.  
  1004.     IF ~SetFirstChar() THEN DO
  1005.         RequestNotify 'TITLE "'global.txt_title_fhand'" PROMPT "'global.txt_err_rend'"'
  1006.         UnlockGUI
  1007.         RETURN
  1008.     END
  1009.     UnlockGUI
  1010.  
  1011.     button = 0
  1012.     WaitForClick 'DOWN POINT SHOWBRUSH'
  1013.     IF RC = 0 THEN
  1014.         PARSE VAR RESULT button x0 y0 .
  1015.  
  1016.     FreeBrush 'FORCE QUIET'
  1017.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1018.     SetPen 'FOREGROUND' global.xorpen
  1019.  
  1020.     IF button > 0 THEN DO
  1021.         prev_xp = x0
  1022.         prev_yp = y0
  1023.         global.xcoord.0 = x0
  1024.         global.ycoord.0 = y0
  1025.         point = 1
  1026.  
  1027.         DO FOREVER
  1028.             GetMousePosition
  1029.             PARSE VAR RESULT xp yp .
  1030.  
  1031.             IF xp ~= prev_xp | yp ~= prev_yp THEN DO
  1032.                 IF point = 1 THEN
  1033.                     nfp = ''
  1034.                 ELSE
  1035.                     nfp = 'NOFIRSTPIXEL'
  1036.                 DrawLine prev_xp prev_yp xp yp 'COMPLEMENT' nfp
  1037.  
  1038.                 global.xcoord.point = xp
  1039.                 global.ycoord.point = yp
  1040.                 point = point + 1
  1041.  
  1042.                 prev_xp = xp
  1043.                 prev_yp = yp
  1044.             END
  1045.             ELSE WaitForEvent
  1046.  
  1047.             GetMouseButton
  1048.             IF RESULT ~= button THEN
  1049.                 LEAVE
  1050.         END
  1051.         IF point = 1 THEN DO
  1052.             point = 2
  1053.             global.xcoord.1 = global.xcoord.0
  1054.             global.ycoord.1 = global.ycoord.0
  1055.         END
  1056.         global.points = point
  1057.     END
  1058.  
  1059.     RETURN
  1060.  
  1061.  
  1062.  
  1063.  
  1064. DefLinear: PROCEDURE EXPOSE global.
  1065.  
  1066.     LockGUI
  1067.     IF global.points > 0 THEN DO
  1068.         CALL XorPath
  1069.         DROP global.xcoord. global.ycoord.
  1070.         global.points = 0
  1071.     END
  1072.  
  1073.     IF ~SetFirstChar() THEN DO
  1074.         RequestNotify 'TITLE "'global.txt_title_fhand'" PROMPT "'global.txt_err_rend'"'
  1075.         UnlockGUI
  1076.         RETURN
  1077.     END
  1078.     UnlockGUI
  1079.  
  1080.     button = 0
  1081.     WaitForClick 'DOWN POINT SHOWBRUSH'
  1082.     IF RC = 0 THEN
  1083.         PARSE VAR RESULT button x0 y0 .
  1084.  
  1085.     FreeBrush 'FORCE QUIET'
  1086.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1087.     SetPen 'FOREGROUND' global.xorpen
  1088.  
  1089.     IF button > 0 THEN DO
  1090.         prev_xp = x0
  1091.         prev_yp = y0
  1092.         global.xcoord.0 = x0
  1093.         global.ycoord.0 = y0
  1094.         drawn = 0
  1095.  
  1096.         DO FOREVER
  1097.             GetMousePosition
  1098.             PARSE VAR RESULT xp yp .
  1099.  
  1100.             IF xp ~= prev_xp | yp ~= prev_yp | ~drawn THEN DO
  1101.                 IF drawn THEN
  1102.                     Undo
  1103.                 DrawLine x0 y0 xp yp 'COMPLEMENT'
  1104.  
  1105.                 global.xcoord.1 = xp
  1106.                 global.ycoord.1 = yp
  1107.                 prev_xp = xp
  1108.                 prev_yp = yp
  1109.                 drawn = 1
  1110.             END
  1111.             ELSE WaitForEvent
  1112.  
  1113.             GetMouseButton
  1114.             IF RESULT ~= button THEN
  1115.                 LEAVE
  1116.         END
  1117.         global.points = 2
  1118.     END
  1119.  
  1120.     RETURN
  1121.  
  1122.  
  1123.  
  1124.  
  1125. InitStep: PROCEDURE EXPOSE global.
  1126.  
  1127.     IF global.points = 2 THEN DO
  1128.         IF global.count > 1 THEN DO
  1129.             global.line_xs = (global.xcoord.1 - global.xcoord.0) / (global.count - 1)
  1130.             global.line_ys = (global.ycoord.1 - global.ycoord.0) / (global.count - 1)
  1131.         END
  1132.         ELSE DO
  1133.             global.line_xs = 0
  1134.             global.line_ys = 0
  1135.         END
  1136.         global.line_xp = global.xcoord.0
  1137.         global.line_yp = global.ycoord.0
  1138.     END
  1139.     ELSE DO
  1140.         global.point_s = global.points / global.count
  1141.         global.point_p = 0
  1142.     END
  1143.  
  1144.     IF global.fromang ~= global.toang | global.rotats > 1 THEN DO
  1145.         global.do_rot = 1
  1146.         IF global.fromang > global.toang & global.rotdir = 0 THEN
  1147.             rotdeg = (3600000 - global.fromang) + global.toang
  1148.         ELSE IF global.fromang < global.toang & global.rotdir = 1 THEN
  1149.             rotdeg = global.fromang + (3600000 - global.toang)
  1150.         ELSE
  1151.             rotdeg = ABS(global.toang - global.fromang)
  1152.  
  1153.         rotdeg = rotdeg + ((global.rotats - 1) * 3600000)
  1154.         IF global.count > 1 THEN
  1155.             global.rot_step =    rotdeg / (global.count - 1)
  1156.         ELSE
  1157.             global.rot_step =    0
  1158.         IF global.rotdir > 0 THEN
  1159.             global.rot_step = -global.rot_step
  1160.     END
  1161.     ELSE
  1162.         global.do_rot = 0
  1163.     global.rot_ang = global.fromang
  1164.  
  1165.     IF global.fromsh ~= global.tosh | global.shears > 1 THEN DO
  1166.         global.do_shear = 1
  1167.         shr_deg = ABS(global.tosh - global.fromsh)
  1168.         IF global.count > 1 THEN
  1169.             global.shear_s = (shr_deg * global.shears) / (global.count - 1)
  1170.         ELSE
  1171.             global.shear_s =    0
  1172.         IF global.tosh < global.fromsh THEN
  1173.             global.shear_s = -global.shear_s
  1174.         global.min_sh = MIN(global.fromsh, global.tosh)
  1175.         global.max_sh = MAX(global.fromsh, global.tosh)
  1176.     END
  1177.     ELSE
  1178.         global.do_shear = 0
  1179.     global.shear = global.fromsh
  1180.  
  1181.     IF global.frombdx ~= global.tobdx | global.frombdy ~= global.tobdy | global.bolds > 1 THEN DO
  1182.         global.do_bold = 1
  1183.         boldx = ABS(global.tobdx - global.frombdx)
  1184.         IF global.count > 1 THEN
  1185.             global.bold_sx =    (boldx * global.bolds) / (global.count - 1)
  1186.         ELSE
  1187.             global.bold_sx =    0
  1188.         IF global.tobdx < global.frombdx THEN
  1189.             global.bold_sx = -global.bold_sx
  1190.         global.min_bdx = MIN(global.frombdx, global.tobdx)
  1191.         global.max_bdx = MAX(global.frombdx, global.tobdx)
  1192.  
  1193.         boldy = ABS(global.tobdy - global.frombdy)
  1194.         IF global.count > 1 THEN
  1195.             global.bold_sy =    (boldy * global.bolds) / (global.count - 1)
  1196.         ELSE
  1197.             global.bold_sy =    0
  1198.         IF global.tobdy < global.frombdy THEN
  1199.             global.bold_sy = -global.bold_sy
  1200.         global.min_bdy = MIN(global.frombdy, global.tobdy)
  1201.         global.max_bdy = MAX(global.frombdy, global.tobdy)
  1202.     END
  1203.     ELSE
  1204.         global.do_bold = 0
  1205.     global.bold_x = global.frombdx
  1206.     global.bold_y = global.frombdy
  1207.  
  1208.     IF global.fromrs ~= global.tors | global.resizes > 1 THEN DO
  1209.         global.do_resize = 1
  1210.         resz = ABS(global.tors - global.fromrs)
  1211.         IF global.count > 1 THEN
  1212.             global.resize_s = (resz * global.resizes) / (global.count - 1)
  1213.         ELSE
  1214.             global.resize_s =    0
  1215.         IF global.tors < global.fromrs THEN
  1216.             global.resize_s = -global.resize_s
  1217.         global.min_rs = MIN(global.fromrs, global.tors)
  1218.         global.max_rs = MAX(global.fromrs, global.tors)
  1219.     END
  1220.     ELSE
  1221.         global.do_resize = 0
  1222.     global.resize = global.fromrs
  1223.  
  1224.     RETURN
  1225.  
  1226.  
  1227.  
  1228.  
  1229. GetStep: PROCEDURE EXPOSE global.
  1230.  
  1231.     IF global.points = 2 THEN DO
  1232.         xp = TRUNC(global.line_xp + 0.5)
  1233.         yp = TRUNC(global.line_yp + 0.5)
  1234.     END
  1235.     ELSE DO
  1236.         point = TRUNC(global.point_p + 0.5)
  1237.         xp = global.xcoord.point
  1238.         yp = global.ycoord.point
  1239.     END
  1240.  
  1241.     RETURN xp yp
  1242.  
  1243.  
  1244.  
  1245.  
  1246. CreateCharacter: PROCEDURE EXPOSE global.
  1247.  
  1248.     antialias = ARG(1)
  1249.     ang  = TRUNC(global.rot_ang / 10 + 0.5)
  1250.     shr  = TRUNC(global.shear / 10 + 0.5 * SIGN(global.shear))
  1251.     bldx = TRUNC(global.bold_x / 10 + 0.5 * SIGN(global.bold_x))
  1252.     bldy = TRUNC(global.bold_y / 10 + 0.5 * SIGN(global.bold_y))
  1253.  
  1254.     IF global.resize ~= 1000000 THEN DO
  1255.         siz = TRUNC(global.size * (global.resize / 1000000) + 0.5)
  1256.         IF siz < 1 THEN
  1257.             siz = 1
  1258.     END
  1259.     ELSE siz = global.size
  1260.  
  1261.     IF global.char = '"' THEN
  1262.         chr = '""'
  1263.     ELSE
  1264.         chr = global.char
  1265.  
  1266.     VectorCharacter 'CHARACTER "'chr'" FONTPATH "'global.fontpath'" FONTNAME "'global.font'" HEIGHT 'siz' ANGLE 'ang' SHEAR 'shr' BOLDX 'bldx' BOLDY 'bldy' ANTIALIAS 'antialias
  1267.     IF RC = 0 THEN DO
  1268.         PARSE VAR RESULT . . hx hy .
  1269.  
  1270.         IF global.handle = 1 THEN
  1271.             SetBrushAttributes 'HANDLEX 'hx' HANDLEY 'hy
  1272.         ELSE IF global.handle = 2 THEN DO
  1273.             GetBrushAttributes 'BOUNDARIES'
  1274.             PARSE VAR RESULT x0 y0 x1 y1 .
  1275.             SetBrushAttributes 'HANDLEX 'x0+((x1-x0+1)%2)' HANDLEY 'y0+((y1-y0+1)%2)
  1276.         END
  1277.         RETURN 1
  1278.     END
  1279.  
  1280.     RETURN 0
  1281.  
  1282.  
  1283.  
  1284.  
  1285. PreviewStep: PROCEDURE EXPOSE global.
  1286.  
  1287.     IF CreateCharacter(0) THEN DO
  1288.         SetPaintMode 'COLOR'
  1289.         Undo global.prvwundo
  1290.  
  1291.         IF ~global.add & global.prvwundo ~= 0 THEN DO
  1292.             IF global.direct = 0 THEN
  1293.                 SetFramePosition 'NEXT'
  1294.             ELSE IF global.direct = 1 THEN
  1295.                 SetFramePosition 'PREVIOUS'
  1296.         END
  1297.         PutBrush ARG(1)
  1298.         global.prvwundo = 1
  1299.         RETURN 1
  1300.     END
  1301.  
  1302.     RETURN 0
  1303.  
  1304.  
  1305.  
  1306.  
  1307. NextStep: PROCEDURE EXPOSE global.
  1308.  
  1309.     IF global.points = 2 THEN DO
  1310.         global.line_xp = global.line_xp + global.line_xs
  1311.         global.line_yp = global.line_yp + global.line_ys
  1312.     END
  1313.     ELSE
  1314.         global.point_p = global.point_p + global.point_s
  1315.  
  1316.     IF global.do_rot THEN
  1317.         global.rot_ang = global.rot_ang + global.rot_step
  1318.  
  1319.     IF global.do_shear THEN DO
  1320.         global.shear = global.shear + global.shear_s
  1321.         IF global.shear_s > 0 THEN DO
  1322.             IF global.shear > global.max_sh THEN DO
  1323.                 excd = global.shear - global.max_sh
  1324.                 global.shear = global.max_sh - excd
  1325.                 global.shear_s = -global.shear_s
  1326.             END
  1327.         END
  1328.         ELSE DO
  1329.             IF global.shear < global.min_sh THEN DO
  1330.                 excd = global.min_sh - global.shear
  1331.                 global.shear = global.min_sh + excd
  1332.                 global.shear_s = -global.shear_s
  1333.             END
  1334.         END
  1335.     END
  1336.  
  1337.     IF global.do_bold THEN DO
  1338.         global.bold_x = global.bold_x + global.bold_sx
  1339.         IF global.bold_sx > 0 THEN DO
  1340.             IF global.bold_x > global.max_bdx THEN DO
  1341.                 excd = global.bold_x - global.max_bdx
  1342.                 global.bold_x = global.max_bdx - excd
  1343.                 global.bold_sx = -global.bold_sx
  1344.             END
  1345.         END
  1346.         ELSE DO
  1347.             IF global.bold_x < global.min_bdx THEN DO
  1348.                 excd = global.min_bdx - global.bold_x
  1349.                 global.bold_x = global.min_bdx + excd
  1350.                 global.bold_sx = -global.bold_sx
  1351.             END
  1352.         END
  1353.  
  1354.         global.bold_y = global.bold_y + global.bold_sy
  1355.         IF global.bold_sy > 0 THEN DO
  1356.             IF global.bold_y > global.max_bdy THEN DO
  1357.                 excd = global.bold_y - global.max_bdy
  1358.                 global.bold_y = global.max_bdy - excd
  1359.                 global.bold_sy = -global.bold_sy
  1360.             END
  1361.         END
  1362.         ELSE DO
  1363.             IF global.bold_y < global.min_bdy THEN DO
  1364.                 excd = global.min_bdy - global.bold_y
  1365.                 global.bold_y = global.min_bdy + excd
  1366.                 global.bold_sy = -global.bold_sy
  1367.             END
  1368.         END
  1369.     END
  1370.  
  1371.     IF global.do_resize THEN DO
  1372.         global.resize = global.resize + global.resize_s
  1373.         IF global.resize_s > 0 THEN DO
  1374.             IF global.resize > global.max_rs THEN DO
  1375.                 excd = global.resize - global.max_rs
  1376.                 global.resize = global.max_rs - excd
  1377.                 global.resize_s = -global.resize_s
  1378.             END
  1379.         END
  1380.         ELSE DO
  1381.             IF global.resize < global.min_rs THEN DO
  1382.                 excd = global.min_rs - global.resize
  1383.                 global.resize = global.min_rs + excd
  1384.                 global.resize_s = -global.resize_s
  1385.             END
  1386.         END
  1387.     END
  1388.  
  1389.     RETURN
  1390.  
  1391.  
  1392.  
  1393.  
  1394. PreviewBegin: PROCEDURE EXPOSE global.
  1395.  
  1396.     SetCurrentBrush 'BRUSH' global.tbshnum
  1397.     SetPen 'FOREGROUND' global.savepen
  1398.     GetFramePosition
  1399.     IF RC = 0 THEN
  1400.         global.savefrpos = RESULT
  1401.     ELSE
  1402.         global.savefrpos = 0
  1403.     global.prvwundo = 0
  1404.  
  1405.     RETURN
  1406.  
  1407.  
  1408.  
  1409.  
  1410. PreviewEnd: PROCEDURE EXPOSE global.
  1411.  
  1412.     Undo global.prvwundo
  1413.     FreeBrush 'FORCE QUIET'
  1414.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1415.     SetPen 'FOREGROUND' global.xorpen
  1416.     IF global.savefrpos > 0 THEN
  1417.         SetFramePosition global.savefrpos
  1418.  
  1419.     RETURN
  1420.  
  1421.  
  1422.  
  1423.  
  1424. PreviewPath: PROCEDURE EXPOSE global.
  1425.  
  1426.     IF global.points = 0 THEN DO
  1427.         RequestNotify 'TITLE "'global.txt_title_pview'" PROMPT "'global.txt_err_nopath'"'
  1428.         RETURN
  1429.     END
  1430.     LockGUI
  1431.     CALL XorPath
  1432.     CALL InitStep
  1433.     CALL PreviewBegin
  1434.  
  1435.     DO cnt = 1 to global.count
  1436.         IF ~PreviewStep( GetStep() ) THEN DO
  1437.             RequestNotify 'TITLE "'global.txt_title_pview'" PROMPT "'global.txt_err_rend'"'
  1438.             LEAVE
  1439.         END
  1440.         Wait 'TIME 200'
  1441.         CALL NextStep()
  1442.     END
  1443.     Wait 'TIME 200'
  1444.  
  1445.     CALL PreviewEnd
  1446.     CALL XorPath
  1447.     UnlockGUI
  1448.  
  1449.     RETURN
  1450.  
  1451.  
  1452.  
  1453.  
  1454. DrawStep: PROCEDURE EXPOSE global.
  1455.  
  1456.     IF CreateCharacter(global.aalias) THEN DO
  1457.         pos = ARG(1)
  1458.         PARSE VAR pos px py .
  1459.         SetPaintMode 'COLOR'
  1460.  
  1461.         IF global.aalias > 0 THEN DO
  1462.             Process 'IMAGE BRUSHMODE X0 'px' Y0 'py' FILTER "Brush Alpha Channel (Single)" NOFS'
  1463.             IF RC ~= 0 THEN DO
  1464.                 IF RC ~= 5 THEN
  1465.                     RequestNotify 'PROMPT "'global.txt_err_rend'('RC')"'
  1466.                 RETURN 0
  1467.             END
  1468.         END
  1469.         ELSE PutBrush px py
  1470.  
  1471.         global.prvwundo = 1
  1472.         RETURN 1
  1473.     END
  1474.  
  1475.     RETURN 0
  1476.  
  1477.  
  1478.  
  1479.  
  1480. DrawIt: PROCEDURE EXPOSE global.
  1481.  
  1482.     IF global.points = 0 THEN DO
  1483.         RequestNotify 'TITLE "'global.txt_title_draw'" PROMPT "'global.txt_err_nopath'"'
  1484.         RETURN 0
  1485.     END
  1486.     LockGUI
  1487.     CALL XorPath
  1488.     CALL InitStep
  1489.     global.pathdisp = 0
  1490.     SetCurrentBrush 'BRUSH' global.tbshnum
  1491.     SetPen 'FOREGROUND' global.savepen
  1492.  
  1493.     IF global.add THEN DO
  1494.         GetFramePosition
  1495.         IF RC = 0 THEN
  1496.             frpos = RESULT
  1497.         ELSE
  1498.             frpos = 0
  1499.         AddFrames global.count
  1500.         IF global.direct = 1 THEN
  1501.             SetFramePosition frpos + global.count
  1502.     END
  1503.  
  1504.     DO cnt = 1 to global.count
  1505.         IF ~DrawStep( GetStep() ) THEN DO
  1506.             RequestNotify 'TITLE "'global.txt_title_draw'" PROMPT "'global.txt_err_rend'"'
  1507.             LEAVE
  1508.         END
  1509.         IF global.direct = 0 THEN
  1510.             SetFramePosition 'NEXT'
  1511.         ELSE IF global.direct = 1 THEN
  1512.             SetFramePosition 'PREVIOUS'
  1513.         CALL NextStep()
  1514.     END
  1515.  
  1516.     FreeBrush 'FORCE QUIET'
  1517.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1518.     SetPen 'FOREGROUND' global.xorpen
  1519.     UnlockGUI
  1520.  
  1521.     RETURN 1
  1522.  
  1523.  
  1524.  
  1525.  
  1526. CharSettings: PROCEDURE EXPOSE global.
  1527.  
  1528.     IF global.fontnum = 0 THEN DO
  1529.         LockGUI
  1530.         global.fontpath = LoadSet('PP_VectorPath', global.fontpath, 1, 0)
  1531.  
  1532.         ftot = 0
  1533.         vftfname = 'ENV:PP_VectorFonts'
  1534.         IF ~OPEN(fexists, vftfname) THEN DO
  1535.             ADDRESS COMMAND 'List >'vftfname' 'global.fontpath' PAT=#?.otag NOHEAD LFORMAT="%s"'
  1536.             ADDRESS COMMAND 'Sort 'vftfname vftfname'.s'
  1537.             IF RC = 0 THEN DO
  1538.                 ADDRESS COMMAND 'Delete >NIL: 'vftfname
  1539.                 ADDRESS COMMAND 'Copy >NIL: 'vftfname'.s' vftfname
  1540.                 ADDRESS COMMAND 'Delete >NIL: 'vftfname'.s'
  1541.             END
  1542.         END
  1543.         ELSE CALL CLOSE(fexists)
  1544.  
  1545.         IF OPEN('listfile', vftfname) THEN DO
  1546.             DO FOREVER
  1547.                 fline = READLN('listfile')
  1548.                 IF EOF('listfile') THEN BREAK
  1549.                 ftot = ftot + 1
  1550.                 global.fontname.ftot = LEFT(fline, LENGTH(fline) - 5)
  1551.             END
  1552.             CALL CLOSE('listfile')
  1553.         END
  1554.         UnlockGUI
  1555.  
  1556.         IF ftot = 0 THEN DO
  1557.             RequestNotify 'PROMPT "'global.txt_err_nofonts'"'
  1558.             RETURN
  1559.         END
  1560.         global.fontnum = ftot
  1561.     END
  1562.  
  1563.     selfont = 0
  1564.     DO f = 1 TO global.fontnum
  1565.         IF UPPER(global.fontname.f) = UPPER(global.font) THEN DO
  1566.             selfont = f - 1
  1567.             LEAVE
  1568.         END
  1569.     END
  1570.  
  1571.     req = '"LIST = ""'global.txt_gad_font'"", 'global.fontnum', 'selfont', 20, 5'
  1572.     DO f = 1 TO global.fontnum
  1573.         req = req || ', ""' || global.fontname.f || '""'
  1574.     END
  1575.     req = req ||,
  1576.          ' VSPACE = 2 ' ||,
  1577.           'STRING = ""'global.txt_gad_char'"", 2, ""'global.char'"" ' ||,
  1578.           'VSPACE = 2 ' ||,
  1579.          'INTSTR = ""'global.txt_gad_size'"", 1, 32000, 'global.size' ' ||,
  1580.           'VSPACE = 2 ' ||,
  1581.             'CYCLE = ""'global.txt_gad_handle'"", 3, 'global.handle', ""'global.txt_gad_handl.0'"", ""'global.txt_gad_handl.1'"", ""'global.txt_gad_handl.2'"" ' ||,
  1582.           'VSPACE = 2 ' ||,
  1583.             'CYCLE = ""'global.txt_gad_aalias'"", 4, 'global.aalias', ""'global.txt_gad_aals.0'"", ""'global.txt_gad_aals.1'"", ""'global.txt_gad_aals.2'"", ""'global.txt_gad_aals.3'"" ' ||,
  1584.           'VSPACE = 2 "'
  1585.  
  1586.     Request 'RESIZE COMPACT "'global.txt_title_char'" 'req
  1587.     IF RC = 0 THEN DO
  1588.         fn = RESULT.1 + 1
  1589.         global.font = global.fontname.fn
  1590.         global.char = RESULT.2
  1591.         global.size = RESULT.3
  1592.         global.handle = RESULT.4
  1593.         global.aalias = RESULT.5
  1594.     END
  1595.  
  1596.     RETURN
  1597.  
  1598.  
  1599.  
  1600.  
  1601. RotSettings: PROCEDURE EXPOSE global.
  1602.  
  1603.     Request '"'global.txt_title_crot'" ',
  1604.             '"INTSTR = ""'global.txt_gad_rotats'"", 1, 32000, 'global.rotats' ',
  1605.             ' INT10000STR = ""'global.txt_gad_fromang'"", 0, 3590000, 'global.fromang' ',
  1606.             ' INT10000STR = ""'global.txt_gad_toang'"", 0, 3590000, 'global.toang' ',
  1607.             ' CYCLE = ""'global.txt_gad_rotdir'"", 2, 'global.rotdir', ""'global.txt_gad_rotdr.0'"", ""'global.txt_gad_rotdr.1'"" "'
  1608.     IF RC = 0 THEN DO
  1609.         global.rotats = RESULT.1
  1610.         global.fromang = RESULT.2
  1611.         global.toang = RESULT.3
  1612.         global.rotdir = RESULT.4
  1613.     END
  1614.  
  1615.     RETURN
  1616.  
  1617.  
  1618.  
  1619.  
  1620. ShearSettings: PROCEDURE EXPOSE global.
  1621.  
  1622.     Request '"'global.txt_title_cshr'" ',
  1623.             '"INTSTR = ""'global.txt_gad_shears'"", 1, 32000, 'global.shears' ',
  1624.             ' INT10000STR = ""'global.txt_gad_fromsh'"", -450000, 450000, 'global.fromsh' ',
  1625.             ' INT10000STR = ""'global.txt_gad_tosh'"", -450000, 450000, 'global.tosh' "'
  1626.     IF RC = 0 THEN DO
  1627.         global.shears = RESULT.1
  1628.         global.fromsh = RESULT.2
  1629.         global.tosh   = RESULT.3
  1630.     END
  1631.  
  1632.     RETURN
  1633.  
  1634.  
  1635.  
  1636.  
  1637. ResizeSettings: PROCEDURE EXPOSE global.
  1638.  
  1639.     Request '"'global.txt_title_cresz'" ',
  1640.             '"INTSTR = ""'global.txt_gad_resizes'"", 1, 32000, 'global.resizes' ',
  1641.             ' INT10000STR = ""'global.txt_gad_fromrs'"", 00100, 320000000, 'global.fromrs' ',
  1642.             ' INT10000STR = ""'global.txt_gad_tors'"", 00100, 320000000, 'global.tors' "'
  1643.     IF RC = 0 THEN DO
  1644.         global.resizes = RESULT.1
  1645.         global.fromrs  = RESULT.2
  1646.         global.tors    = RESULT.3
  1647.     END
  1648.  
  1649.     RETURN
  1650.  
  1651.  
  1652.  
  1653.  
  1654. BoldSettings: PROCEDURE EXPOSE global.
  1655.  
  1656.     Request '"'global.txt_title_cbold'" ',
  1657.             '"INTSTR = ""'global.txt_gad_bolds'"", 1, 32000, 'global.bolds' ',
  1658.             ' INT10000STR = ""'global.txt_gad_frombdx'"", -80000, 80000, 'global.frombdx' ',
  1659.             ' INT10000STR = ""'global.txt_gad_tobdx'"", -80000, 80000, 'global.tobdx' ',
  1660.             ' INT10000STR = ""'global.txt_gad_frombdy'"", -80000, 80000, 'global.frombdy' ',
  1661.             ' INT10000STR = ""'global.txt_gad_tobdy'"", -80000, 80000, 'global.tobdy' "'
  1662.     IF RC = 0 THEN DO
  1663.         global.bolds   = RESULT.1
  1664.         global.frombdx = RESULT.2
  1665.         global.tobdx   = RESULT.3
  1666.         global.frombdy = RESULT.4
  1667.         global.tobdy   = RESULT.5
  1668.     END
  1669.  
  1670.     RETURN
  1671.  
  1672.  
  1673.  
  1674.  
  1675. DisplayData: PROCEDURE EXPOSE global.
  1676.  
  1677.     direct = global.direct
  1678.     add = global.add
  1679.     rotdir = global.rotdir
  1680.     handle = global.handle
  1681.     antialias = global.aalias
  1682.  
  1683.     str = COMPRESS(global.txt_gad_count, '_') global.count || '0A'x ||,
  1684.           COMPRESS(global.txt_gad_direct, '_') global.txt_gad_dirct.direct || '0A'x ||,
  1685.           COMPRESS(global.txt_gad_add, '_') global.txt_gad_noyes.add || '0A'x ||,
  1686.           '0A'x ||,
  1687.           COMPRESS(global.txt_gad_font, '_') global.font || '0A'x ||,
  1688.           COMPRESS(global.txt_gad_char, '_') global.char || '0A'x ||,
  1689.           COMPRESS(global.txt_gad_size, '_') global.size || '0A'x ||,
  1690.           COMPRESS(global.txt_gad_handle, '_') global.txt_gad_handl.handle || '0A'x ||,
  1691.           COMPRESS(global.txt_gad_aalias, '_') global.txt_gad_aals.antialias || '0A'x ||,
  1692.           '0A'x ||,
  1693.           COMPRESS(global.txt_gad_rotats, '_') global.rotats || '0A'x ||,
  1694.           COMPRESS(global.txt_gad_fromang, '_') (global.fromang / 10000) || '0A'x ||,
  1695.           COMPRESS(global.txt_gad_toang, '_') (global.toang / 10000) || '0A'x ||,
  1696.           COMPRESS(global.txt_gad_rotdir, '_') global.txt_gad_rotdr.rotdir || '0A'x ||,
  1697.           '0A'x ||,
  1698.           COMPRESS(global.txt_gad_shears, '_') global.shears || '0A'x ||,
  1699.           COMPRESS(global.txt_gad_fromsh, '_') (global.fromsh / 10000) || '0A'x ||,
  1700.           COMPRESS(global.txt_gad_tosh, '_') (global.tosh / 10000) || '0A'x ||,
  1701.           '0A'x ||,
  1702.           COMPRESS(global.txt_gad_resizes, '_') global.resizes || '0A'x ||,
  1703.           COMPRESS(global.txt_gad_fromrs, '_') (global.fromrs / 10000) || '0A'x ||,
  1704.           COMPRESS(global.txt_gad_tors, '_') (global.tors / 10000) || '0A'x ||,
  1705.           '0A'x ||,
  1706.           COMPRESS(global.txt_gad_bolds, '_') global.bolds || '0A'x ||,
  1707.           COMPRESS(global.txt_gad_frombdx, '_') global.frombdx || '0A'x ||,
  1708.           COMPRESS(global.txt_gad_tobdx, '_') global.tobdx || '0A'x ||,
  1709.           COMPRESS(global.txt_gad_frombdy, '_') global.frombdy || '0A'x ||,
  1710.           COMPRESS(global.txt_gad_tobdy, '_') global.tobdy || '0A'x
  1711.  
  1712.     pos = 1
  1713.     DO FOREVER
  1714.         pos = INDEX(str, '"', pos)
  1715.         IF pos = 0 THEN
  1716.             BREAK
  1717.         str = INSERT('"', str, pos)
  1718.         pos = pos + 2
  1719.     END
  1720.  
  1721.     IF global.points > 0 THEN DO
  1722.         IF global.points = 2 THEN
  1723.             ptype = 1
  1724.         ELSE
  1725.             ptype = 0
  1726.  
  1727.         str = str ||,
  1728.               '0A'x ||,
  1729.               global.txt_msg_points global.points global.txt_msg_ptype.ptype || '0A'x ||,
  1730.               '0A'x
  1731.  
  1732.         DO point = 0 FOR global.points
  1733.             str = str || global.xcoord.point','global.ycoord.point || '0A'x
  1734.         END
  1735.     END
  1736.     RequestNotify '"'global.txt_title_data'" "'str'" SCROLL'
  1737.  
  1738.     RETURN
  1739.  
  1740.  
  1741.  
  1742.  
  1743. XorPath: PROCEDURE EXPOSE global.
  1744.  
  1745.     IF global.points > 0 THEN DO
  1746.         xp = global.xcoord.0
  1747.         yp = global.ycoord.0
  1748.         last = global.points - 1
  1749.  
  1750.         DO point = 1 TO last
  1751.             IF point = 1 THEN
  1752.                 nfp = ''
  1753.             ELSE
  1754.                 nfp = 'NOFIRSTPIXEL'
  1755.             DrawLine xp yp global.xcoord.point global.ycoord.point 'COMPLEMENT' nfp
  1756.  
  1757.             xp = global.xcoord.point
  1758.             yp = global.ycoord.point
  1759.         END
  1760.     END
  1761.  
  1762.     RETURN
  1763.  
  1764.  
  1765.  
  1766.  
  1767. LoadSet: PROCEDURE
  1768.  
  1769.     sname = ARG(1)
  1770.     def_val = ARG(2)
  1771.     IF ARG() > 2 THEN
  1772.         global_set = ARG(3)
  1773.     ELSE
  1774.         global_set = 0
  1775.     IF ARG() > 3 THEN
  1776.         request_quote = ARG(4)
  1777.     ELSE
  1778.         request_quote = 1
  1779.  
  1780.     val = def_val
  1781.     IF global_set THEN
  1782.         set_fname = 'ENV:'sname
  1783.     ELSE
  1784.         set_fname = 'ENV:PP_AnimChar_'sname
  1785.  
  1786.     IF OPEN('settingfile', set_fname, 'R') THEN DO
  1787.         val = READCH('settingfile', 65535)
  1788.         CALL CLOSE('settingfile')
  1789.     END
  1790.  
  1791.     IF request_quote THEN DO
  1792.         /* encode quotes for the Request command ('"' -> '\""') */
  1793.         qpos_start = 1
  1794.         DO FOREVER
  1795.             qpos = INDEX(val, '"', qpos_start)
  1796.             IF qpos = 0 THEN BREAK
  1797.             val = INSERT('\"', val, qpos-1)
  1798.             qpos_start = qpos + 3
  1799.         END
  1800.     END
  1801.  
  1802.     RETURN val
  1803.  
  1804.  
  1805.  
  1806.  
  1807. Cleanup: PROCEDURE EXPOSE global.
  1808.  
  1809.     IF global.pathdisp THEN DO
  1810.         LockGUI
  1811.         CALL XorPath
  1812.         UnlockGUI
  1813.     END
  1814.  
  1815.     RETURN
  1816.  
  1817.  
  1818.  
  1819.  
  1820. Break_C:
  1821.  
  1822.     SetCurrentBrush 'RECTANGULAR WIDTH 1 HEIGHT 1'
  1823.     SetPen 'FOREGROUND' global.xorpen
  1824.     CALL Cleanup
  1825.  
  1826.     LockGUI
  1827.     SetPen 'FOREGROUND' global.savepen
  1828.     SetCurrentBrush global.savebsh
  1829.     SetPaintMode global.savepmode
  1830.     IF global.savebshfr > 1 THEN
  1831.         SetBrushAttributes 'FRAMEPOSITION' global.savebshfp
  1832.     Set '"BARS='savebars'"'
  1833.     Set '"GCLIP='saveclip'"'
  1834.     Set '"COORD='savecoord'"'
  1835.     EnableTools
  1836.     UnlockGUI
  1837.  
  1838.     RETURN
  1839.